<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="/white/common/taglibs.jsp"%>
<%@include file="/white/common/common.jsp"%>

<html>
	<head>
		<script type="text/javascript">
			function toProdClassSel() {
				var url = ""

				url = "prodGroupAction!toProdClassSel.action";

				openWindow(url, 850, 500);
			}
			function toManageRegionSel() {
				var url = ""

				url = "prodGroupAction!toManageRegionSel.action";
				
				openWindow(url, 850, 500);
			}
			function toManageRegionSelTree() {
				var url = ""

				//url = "prodGroupAction!toManageRegionSelTree.action";
				url = "manageRegionAction!querySelByPageTree.action";
				

				openWindow(url, 850, 500);
			}
			
			function toProdClassSelTwo() {
				var url = ""

				url = "prodGroupAction!toProdClassSelTwo.action";

				openWindow(url, 850, 500);
			}
			
			function add() {
				document.addform.submit();
				document.addform.addprodgroup.disabled=true;
			}
			function oneClassonblur(obj){
				var code=obj.value;
				 var content_Type = "application/x-www-form-urlencoded;charset=UTF-8";
					jQuery.ajax({
					url : 'prodGroupAction!getProdClassByCode.action',
					type : "POST",
					contentType : content_Type,
					dataType : "text",
					data:{'class_code':code},
					error : function(textStatus, errorThrown) {
					},
					success : function(html) {
					$("#prodClassName1").val(html);
					}
				});
				
			} 
			function oneClass2onblur(obj){
				var code=obj.value;
				 var content_Type = "application/x-www-form-urlencoded;charset=UTF-8";
					jQuery.ajax({
					url : 'prodGroupAction!getProdClassByCode.action',
					type : "POST",
					contentType : content_Type,
					dataType : "text",
					data:{'class_code':code},
					error : function(textStatus, errorThrown) {
					},
					success : function(html) {
					$("#prodClassName2").val(html);
					}
				});
				
			} 
			
			
			
		</script>
	</head>
	
	<body>
		<div id="div_title">
			<h3>
				产品品牌新增
			</h3>
		</div>

		<!-- Data Form -->
		<%@include file="/white/common/message.jsp"%>
		<s:form method="post" action="prodGroupAction!save"   theme="simple" enctype="multipart/form-data" id="addform">
			<s:token />

			<table cellpadding="0" cellspacing="0" class="t_form">
				<tr>
					<td width="15%">
						一级分类编号:
					</td>
					<td>
						<s:textfield id= "prodClassCode1" name="prodGroup.prodClassCode1" maxlength="64" onblur="oneClassonblur(this)"/>
						<span class="red_star">*</span>
						&nbsp;&nbsp;一级分类名称:
						<s:textfield id= "prodClassName1" name="prodGroup.prodClassName1" maxlength="64" readonly="true" />
						<s:submit value=".." onclick="toProdClassSel();return false;" cssClass="input_button" />						
					</td>
				</tr>
<tr>
					<td width="15%">
						二级分类编号:
					</td>
					<td>
						<s:textfield id= "prodClassCode2" name="prodGroup.prodClassCode2" maxlength="64" onblur="oneClass2onblur(this)" />
						<span class="red_star">*</span>
						&nbsp;&nbsp;二级分类名称:
						<s:textfield id= "prodClassName2" name="prodGroup.prodClassName2" maxlength="64" readonly="true" />
						<!-- <s:submit value=".." onclick="toProdClassSelTwo();return false;" cssClass="input_button" /> -->
					</td>
				</tr>
				<tr>
				</tr>
				<tr>
					<td width="15%">
						品牌名称1:
					</td>
					<td>
						<s:textfield name="prodGroup.name1" maxlength="64" />
						<span class="red_star">*</span>
					</td>
				</tr>
				<tr>
					<td width="15%">
						品牌名称2:
					</td>
					<td>
						<s:textfield name="prodGroup.name2" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						分列名1:
					</td>
					<td>
						<s:textfield name="prodGroup.subname1" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						区号:
					</td>
					<td>
						<s:textfield name="prodGroup.areaCode" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						电话:
					</td>
					<td>
						<s:textfield name="prodGroup.tel" maxlength="64" />
						<span class="red_star">*</span>
					</td>
				</tr>
				
				<tr>
					<td width="15%">
						电话2:
					</td>
					<td>
						<s:textfield name="prodGroup.tel2" maxlength="64" />
						
					</td>
				</tr>
					<tr>
					<td width="15%">
						分机:
					</td>
					<td>
						<s:textfield name="prodGroup.telExt" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						地区代码:
					</td>
					<td>
						<s:textfield id="regionCode" name="prodGroup.regionCode" maxlength="64" readonly="true" />
						<span class="red_star">*</span>
						<s:submit value=".." onclick="toManageRegionSelTree();return false;" cssClass="input_button" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						城市代码:
					</td>
					<td>
						<s:textfield id="cityCode" name="prodGroup.cityCode" maxlength="64" />
						<span class="red_star">*</span>
					</td>
				</tr>
				<tr>
					<td width="15%">
						城市名称:
					</td>
					<td>
						<s:textfield id="cityName" name="prodGroup.cityName" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						区域代码:
					</td>
					<td>
						<s:textfield id="destrictCode" name="prodGroup.destrictCode" maxlength="64" />
						<span class="red_star">*</span>
					</td>
				</tr>
				<tr>
					<td width="15%">
						区域名称:
					</td>
					<td>
						<s:textfield id="destrictName" name="prodGroup.destrictName" maxlength="64" />
					</td>
				</tr>
				
				
				
				
				
				
				
				
				
				
				<tr>
					<td width="15%">
						地址:
					</td>
					<td>
						<s:textfield name="prodGroup.addr" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						邮编:
					</td>
					<td>
						<s:textfield name="prodGroup.zip" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						列名次序:
					</td>
					<td>
						<s:textfield name="prodGroup.listOrder" value="99"maxlength="64" />						
						<span class="red_star">*</span>
					</td>
				</tr>
				<tr>
					<td width="15%">
						Url:
					</td>
					<td>
						<s:textfield name="prodGroup.url" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						微博:
					</td>
					<td>
						<s:textfield name="prodGroup.weibo" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						微博名称:
					</td>
					<td>
						<s:textfield name="prodGroup.weiboName" maxlength="32" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						微信:
					</td>
					<td>
						<s:textfield name="prodGroup.weixin" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						易信:
					</td>
					<td>
						<s:textfield name="prodGroup.yixin" maxlength="64" />
					</td>
				</tr>
				<tr>
					<td width="15%">
						Logo:
					</td>
					<td>
						<input type="file" name="upload" />
					</td>
				</tr>
			</table>

			<div id="div_button">

<%-- 				<s:submit key="添加" action="prodGroupAction!save" id="addprodgroup"
					onclick="if(validateForm()){return true;}else{return false;}"
					cssClass="input_button" /> --%>
					<input type="button" value="添加" onclick="add()" id="addprodgroup"
				class="input_button" /> 
				<input type="button" value="返回"
					onclick="window.close();"
					class="input_button" />
			</div>

			<s:hidden name="searchString" />

		</s:form>
		<!--Data Form End -->

	</body>

</html>